<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>带背景的文字效果</title>
    <style>
        .clip {
            font-size: 200px;
            height: 300px;
            background: url(./1.jpg) center center no-repeat;
            background-size: 100% 100%;
            /* 核心配置background-clip  color*/
            background-clip: text;
            -webkit-background-clip: text;
            color: transparent;
        }

        .mask {
            width: 500px;
            height: 300px;
            mask-image: url(./mask.png);
            -webkit-mask-image: url(./mask.png);
            background-image: linear-gradient(353deg, #89C027, #89C027 28%, #E96036 28%, #E96036 49%, #FEF158 49%, #FEF158 72%, #76C5EE 72%);
        }
    </style>
</head>

<body>
    <div class="clip">clip template</div>
    <!-- bilibili弹幕不遮挡人物原理 图片透明部分不显示内容 -->
    <div class="mask"></div>
</body>

</html>